package com.mk.domain;

import com.github.d925529.apidoc.annotation.ApiField;
import org.beetl.sql.core.annotatoin.*;
import org.beetl.sql.core.mapper.BaseMapper;

import java.io.Serializable;
import java.util.List;

/**
 * 说明：
 * 作者：刘永盛
 * 日期：2018-7-14 19:32:40
 * 版本：1.0.0
 */
@Table(name = "cp_config")
@SuppressWarnings("unused")
public class CpConfig implements Serializable {
    @AssignID
    @ApiField("cfid")
    private String cfid;

    //value
    @ApiField("cfvalue")
    private String cfvalue;

    //value
    @ApiField("cftype")
    private String cftype;

    //value
    @ApiField("cforder")
    private Integer cforder;

    /**
     * @return key
     */
    public String getCfid() {
        return cfid;
    }

    /**
     * @param cfid key
     */
    public void setCfid(String cfid) {
        this.cfid = cfid;
    }

    /**
     * @return value
     */
    public String getCfvalue() {
        return cfvalue;
    }

    /**
     * @param cfvalue value
     */
    public void setCfvalue(String cfvalue) {
        this.cfvalue = cfvalue;
    }

    public String getCftype() {
        return cftype;
    }

    public void setCftype(String cftype) {
        this.cftype = cftype;
    }

    public Integer getCforder() {
        return cforder;
    }

    public void setCforder(Integer cforder) {
        this.cforder = cforder;
    }

    public interface Mapper extends BaseMapper<CpConfig> {
        List<CpConfig> selectConfigIndex();

        @SqlStatement(type = SqlStatementType.INSERT)
        int saveConfigIndex(@Param("configs") List<CpConfig> configs);

        void saveConfigList(@Param("cftype") String cftype, @Param("configs") List<CpConfig> configs);

        List<CpConfig> getConfigListByCftype(@Param("cftype") String cftype);
    }
}